package cn.heyige.backend.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("ai_message")
public class AiMessageDO {
    
    @TableId(type = IdType.AUTO)
    private Integer id;
    
    @TableField("session_id")
    private Integer sessionId;
    
    @TableField("role")
    private String role;
    
    @TableField("content")
    private String content;
    
    @TableField("token_count")
    private Integer tokenCount;
    
    @TableField("is_deleted")
    @TableLogic
    private Boolean isDeleted = false;
    
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;
    
    public enum MessageRole {
        USER, ASSISTANT, SYSTEM
    }
}